﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RegionAdd.aspx.cs" Inherits="PersonalInfoManage_RegionAdd" %>

<%@ Register Src="../UserControl/MenuControl.ascx" TagName="menu" TagPrefix="UC" %>
<%@ Register Src="../UserControl/Top.ascx" TagName="top" TagPrefix="UC" %>
<%@ Register Src="../UserControl/foot.ascx" TagName="footer" TagPrefix="UC" %>
<%@ Import Namespace="BLL.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>添加专区</title>
    <link type="text/css" href="../Styles/Style.css" rel="stylesheet" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <link type="text/css" href="../Scripts/UIModule/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
    <script type="text/javascript" src="../Scripts/UIModule/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript" src="../Scripts/Check.js"></script>
    <script type="text/javascript">
        //校验用户名
        function checkRegionName() {
            $("#NullRegionNameError").css("display", "none");
            $("#RegionNameError").css("display", "none");
            var obj = $("#regionTitle");
            var val;
            if (typeof (obj.value) == "undefined") {
                val = obj.val();
            }
            else {
                val = obj.value;
            }
            if ($.trim(val).length < 1) {
                $("#NullRegionNameError").css("display", "block");
                return false;
            }
            else {
                var flg = updateflg.value;
                var result = true;
                $("#RegionNameError").css("display", "none");
                $.ajax({
                    url: "../JSPost/Check.aspx?flg=" + flg,
                    type: "POST",
                    async: false,
                    data: { "action": "checkRegionName", "name": val },
                    success: function (isTrue, status) {
                        if (status == "success") {
                            if (isTrue == "True") {
                                $("#RegionNameError").css("display", "none");
                                result = true;
                            }
                            else {
                                $("#RegionNameError").css("display", "block");
                                result = false;
                            }
                        }
                    }
                }
                );
                return result;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="page" id="pall">
        <input runat="server" type="hidden" id="famousRegionID" />
        <input runat="server" type="hidden" id="updateflg" />
        <!--right top-->
        <UC:top ID="top" runat="server"></UC:top>
        <UC:menu ID="menu" runat="server"></UC:menu>
        <div class="page_right" id="pright">
            <div class="right_top">
                <div class="ltitle">
                    <ul class="right_top_down">
                        <li class="dtitle"><span class="iconE"></span><font><b>您当前的位置:</b> 首页>>添加专区</font>
                        </li>
                    </ul>
                </div>
            </div>
            <!--right middle-->
            <div class="right_middle" style="overflow: hidden;">
                <div class="right_pannel">
                    <div class="right_box">
                        <div class="box_title">
                            <b>添加区域 </b>
                        </div>
                        <table class="usertb">
                            <tr>
                                <td class="lctext" style="width: 20%">
                                    <font color="red">* </font>专区标题
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="regionTitle" class="inputtext" Width="200px"></asp:TextBox>
                                    <div class="reg_column reg_column_01">
                                        <span id="RegionNameError" style="display: none;"><span class="error">
                                            <img src="../images/regerror.gif" /></span> <span class="errortxt">此专区名已存在，请重新输入
                                            </span></span><span id="NullRegionNameError" style="display: none;"><span class="error">
                                                <img src="../images/regerror.gif" /></span> <span class="errortxt">专区名必须输入 </span>
                                            </span>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="lctext">
                                    专区人名
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="regionUserName" class="inputtext" Width="200px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="lctext">
                                    专区人籍贯
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="regionUserAddr" class="inputtext" Width="200px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="lctext">
                                    个人图片
                                </td>
                                <td>
                                        <asp:FileUpload ID="file" runat="server" />
                                   <%-- <asp:TextBox runat="server" ID="TextBox1" class="inputtext" Width="200px"></asp:TextBox>--%>
                                </td>
                            </tr>
                            <tr>
                                <td class="lctext">
                                </td>
                                <td align="left">
                                    <input type="reset" value="重置" class='btnStyle2' />
                                    <asp:Button ID="SubmitButton" runat="server" Text="提交" class='btnStyle2' OnClientClick="return checkRegionName();"
                                        OnClick="SubmitButton_Click" />
                                    <asp:Button ID="UpdateButton" runat="server" Text="更新" class='btnStyle2' OnClientClick="return checkRegionName();"
                                        Visible="true" OnClick="UpdateButton_Click" />
                                </td>
                            </tr>
                        </table>
                        <div class="box_title">
                            <b>显示列表 </b>
                        </div>
                        <div>
                            <asp:DataGrid ID="FamousRegionDataGrid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                Height="1px" Width="97%" GridLines="Both" ForeColor="#000000" Font-Bold="False"
                                Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
                                PageSize="5" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" OnDeleteCommand="FamousRegionDataGrid_DeleteCommand"
                                OnPageIndexChanged="FamousRegionDataGrid_PageIndexChanged">
                                <Columns>
                                    <asp:BoundColumn DataField="FamousRegionId" HeaderText="编号" Visible="false"></asp:BoundColumn>
                                    <asp:BoundColumn DataField="Title" HeaderText="专区标题" ReadOnly="True"></asp:BoundColumn>
                                    <asp:BoundColumn DataField="Name" HeaderText="专区人名" ItemStyle-Wrap="false"></asp:BoundColumn>
                                    <asp:BoundColumn DataField="Address" HeaderText="专区人籍贯" ItemStyle-Wrap="false"></asp:BoundColumn>
                                    <asp:BoundColumn DataField="ImageSrc" HeaderText="头像文件名" ItemStyle-Wrap="false"></asp:BoundColumn>
                                    <asp:BoundColumn DataField="LastUpdate" HeaderText="最后更新时间" ReadOnly="True"></asp:BoundColumn>
                                    <asp:ButtonColumn CommandName="Delete" HeaderText="删除" Text="删除"></asp:ButtonColumn>
                                    <asp:HyperLinkColumn Target="_self" DataTextFormatString="编辑" DataTextField="FamousRegionId"
                                        DataNavigateUrlField="FamousRegionId" DataNavigateUrlFormatString="./RegionAdd.aspx?UID={0}"
                                        HeaderText="编辑" />
                                </Columns>
                                <HeaderStyle Font-Bold="True" BackColor="#507CD1" ForeColor="White" />
                                <PagerStyle NextPageText="下一页" PrevPageText="上一页" BackColor="InactiveCaptionText"
                                    ForeColor="Black" HorizontalAlign="Right" Font-Size="Larger" PageButtonCount="5" />
                                <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
                                <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <EditItemStyle BackColor="#2461BF" />
                                <AlternatingItemStyle BackColor="White" />
                                <ItemStyle BackColor="#EFF3FB" />
                            </asp:DataGrid>
                        </div>
                        <%--</div>--%>
                    </div>
                </div>
            </div>
            <!--right down-->
            <div class="right_down">
            </div>
        </div>
    </div>
    </form>
</body>
</html>
